package parser;

import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
import java.io.InputStream;


/**
 *
 * @author Ilio Catallo, Eleonora Ciceri
 * @version: 1.0
 * 
 * Description: The class implements a generic parser for 
 *              processing web service responses
 * 
 * Date: Nov 16, 2011
 */
public abstract class Parser {
    
    // Attributes
    protected HashMap<String, String> attributes;
    protected List<HashMap<String, String>> responseAttributes;
    protected List<String> navigationPath;
    
    /**
     * Constructor for the class Parser
     * @param attributes 
     */
    public Parser() {
        
        this.responseAttributes = new ArrayList<HashMap<String, String>>();
        this.navigationPath = new ArrayList<String>();
    }

    /**
     * Method that returns the response attributes
     * @return attributes
     */
    public List<HashMap<String, String>> getResponseAttributes() {
        return responseAttributes;
    }

    public void setAttributes(HashMap<String, String> attributes) {
        this.attributes = attributes;
    }

    public void setNavigationPath(List<String> navigationPath) {
        this.navigationPath = navigationPath;
    }
 
    public abstract void parse(InputStream document);
    
}
